package com.uzai.console.service.order.impl;

import com.uzai.common.enums.OrderStatusEnum;
import com.uzai.console.enums.DyOrderPlatformStatusEnum;
import com.uzai.console.service.order.OrderStatusService;
import com.uzai.console.vo.order.DyOrderPlatformStatusVo;
import com.uzai.console.vo.order.OrderStatusVo;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 订单状态
 * @author liuqi
 * @date 2021年08月19日 16:50
 */
@Service
public class OrderStatusServiceImpl implements OrderStatusService {

    /**
     * 查询订单状态列表
     * @author liuqi
     * @date 2021/8/19 16:51
     * @return java.util.List<com.uzai.console.vo.order.OrderStatusVo>
     */
    public List<OrderStatusVo> findOrderStatusList(){
        //新建返回集合
        List<OrderStatusVo> orderStatusVoList = new ArrayList<OrderStatusVo>();
        //获取订单状态枚举
        OrderStatusEnum[] orderStatusesArr = OrderStatusEnum.values();
        //遍历订单状态枚举
        for (OrderStatusEnum orderStatusEnum :orderStatusesArr){
            OrderStatusVo orderStoatusVo = new OrderStatusVo();
            orderStoatusVo.setKey(orderStatusEnum.getValue());
            orderStoatusVo.setValue(orderStatusEnum.getDesc());
            orderStatusVoList.add(orderStoatusVo);
        }
        return orderStatusVoList;
    }

    /**
     * 查询淘宝订单状态列表
     * @author liuqi
     * @date 2021/8/19 16:51
     * @return java.util.List<com.uzai.console.vo.order.OrderStatusVo>
     */
    public List<OrderStatusVo> findTbOrderStatusList(){
        //新建返回集合
        List<OrderStatusVo> orderStatusVoList = new ArrayList<OrderStatusVo>();
        //获取订单状态枚举
        OrderStatusEnum[] orderStatusesArr = OrderStatusEnum.values();
        //遍历订单状态枚举
        for (OrderStatusEnum orderStatusEnum :orderStatusesArr){
            if(orderStatusEnum.getValue().intValue() == 0               //订单付款
                    ||orderStatusEnum.getValue().intValue() == 1        //订单结算
                    ||orderStatusEnum.getValue().intValue() == 2        //订单失效
                    ||orderStatusEnum.getValue().intValue() == 3        //维权创建
                    ||orderStatusEnum.getValue().intValue() == 4        //维权退款
                    ||orderStatusEnum.getValue().intValue() == 5        //维权失败
                    ||orderStatusEnum.getValue().intValue() == 6        //订单成功
                    ||orderStatusEnum.getValue().intValue() == 8        //处罚订单
            ) {
                OrderStatusVo orderStoatusVo = new OrderStatusVo();
                orderStoatusVo.setKey(orderStatusEnum.getValue());
                orderStoatusVo.setValue(orderStatusEnum.getDesc());
                orderStatusVoList.add(orderStoatusVo);
            }
        }
        return orderStatusVoList;
    }

    /**
     * 查询抖音订单状态列表
     * @author liuqi
     * @date 2021/8/19 16:51
     * @return java.util.List<com.uzai.console.vo.order.OrderStatusVo>
     */
    public List<OrderStatusVo> findDyOrderStatusList(){
        //新建返回集合
        List<OrderStatusVo> orderStatusVoList = new ArrayList<OrderStatusVo>();
        //获取订单状态枚举
        OrderStatusEnum[] orderStatusesArr = OrderStatusEnum.values();
        //遍历订单状态枚举
        for (OrderStatusEnum orderStatusEnum :orderStatusesArr){
            if(orderStatusEnum.getValue().intValue() == 0               //订单付款
                    ||orderStatusEnum.getValue().intValue() == 1        //订单结算
                    ||orderStatusEnum.getValue().intValue() == 2        //订单失效
                    ||orderStatusEnum.getValue().intValue() == 3        //维权创建
                    ||orderStatusEnum.getValue().intValue() == 4        //维权成功
            ){
                OrderStatusVo orderStoatusVo = new OrderStatusVo();
                orderStoatusVo.setKey(orderStatusEnum.getValue());
                orderStoatusVo.setValue(orderStatusEnum.getDesc());
                orderStatusVoList.add(orderStoatusVo);
            }
        }
        return orderStatusVoList;
    }

    /**
     * 查询抖音订单平台状态列表
     * @author liuqi
     * @date 2021/8/19 16:51
     * @return java.util.List<com.uzai.console.vo.order.OrderStatusVo>
     */
    public List<DyOrderPlatformStatusVo> getDyOrderPlatformStatusList(){
        //新建返回集合
        List<DyOrderPlatformStatusVo> dyOrderPlatformStatusVoList = new ArrayList<>();
        //获取订单状态枚举
        DyOrderPlatformStatusEnum[] dyOrderPlatformStatusEnums = DyOrderPlatformStatusEnum.values();
        //遍历订单状态枚举
        for (DyOrderPlatformStatusEnum dyOrderPlatformStatusEnum :dyOrderPlatformStatusEnums){
                DyOrderPlatformStatusVo dyOrderPlatformStatusVo = new DyOrderPlatformStatusVo();
                dyOrderPlatformStatusVo.setKey(dyOrderPlatformStatusEnum.getStatus());
                dyOrderPlatformStatusVo.setValue(dyOrderPlatformStatusEnum.getDesc());
                dyOrderPlatformStatusVoList.add(dyOrderPlatformStatusVo);
        }
        return dyOrderPlatformStatusVoList;
    }


    /**
     * 查询京东订单状态列表
     * @author liuqi
     * @date 2021/8/19 16:51
     * @return java.util.List<com.uzai.console.vo.order.OrderStatusVo>
     */
    public List<OrderStatusVo> findJdOrderStatusList(){
        //新建返回集合
        List<OrderStatusVo> orderStatusVoList = new ArrayList<OrderStatusVo>();
        //获取订单状态枚举
        OrderStatusEnum[] orderStatusesArr = OrderStatusEnum.values();
        //遍历订单状态枚举
        for (OrderStatusEnum orderStatusEnum :orderStatusesArr){
            if(orderStatusEnum.getValue().intValue() == 0               //订单付款
                    ||orderStatusEnum.getValue().intValue() == 1        //订单结算
                    ||orderStatusEnum.getValue().intValue() == 2        //订单失效
                    ||orderStatusEnum.getValue().intValue() == 4        //维权成功
                    ||orderStatusEnum.getValue().intValue() == 7        //失效拆单
                    ||orderStatusEnum.getValue().intValue() == 8        //处罚订单
            ){
                OrderStatusVo orderStoatusVo = new OrderStatusVo();
                orderStoatusVo.setKey(orderStatusEnum.getValue());
                orderStoatusVo.setValue(orderStatusEnum.getDesc());
                orderStatusVoList.add(orderStoatusVo);
            }
        }
        return orderStatusVoList;
    }

    /**
     * 查询拼多多订单状态列表
     * @author liuqi
     * @date 2021/8/19 16:51
     * @return java.util.List<com.uzai.console.vo.order.OrderStatusVo>
     */
    public List<OrderStatusVo> findPddOrderStatusList(){
        //新建返回集合
        List<OrderStatusVo> orderStatusVoList = new ArrayList<OrderStatusVo>();
        //获取订单状态枚举
        OrderStatusEnum[] orderStatusesArr = OrderStatusEnum.values();
        //遍历订单状态枚举
        for (OrderStatusEnum orderStatusEnum :orderStatusesArr){
            if(orderStatusEnum.getValue().intValue() == 0               //订单付款
                    ||orderStatusEnum.getValue().intValue() == 1        //订单结算
                    ||orderStatusEnum.getValue().intValue() == 2        //订单失效
                    ||orderStatusEnum.getValue().intValue() == 4        //维权成功
                    ||orderStatusEnum.getValue().intValue() == 8        //处罚订单
            ){
                OrderStatusVo orderStoatusVo = new OrderStatusVo();
                orderStoatusVo.setKey(orderStatusEnum.getValue());
                orderStoatusVo.setValue(orderStatusEnum.getDesc());
                orderStatusVoList.add(orderStoatusVo);
            }
        }
        return orderStatusVoList;
    }

    /**
     * 查询唯品会订单状态列表
     * @author liuqi
     * @date 2021/8/19 16:51
     * @return java.util.List<com.uzai.console.vo.order.OrderStatusVo>
     */
    public List<OrderStatusVo> findVphOrderStatusList(){
        //新建返回集合
        List<OrderStatusVo> orderStatusVoList = new ArrayList<OrderStatusVo>();
        //获取订单状态枚举
        OrderStatusEnum[] orderStatusesArr = OrderStatusEnum.values();
        //遍历订单状态枚举
        for (OrderStatusEnum orderStatusEnum :orderStatusesArr){
            if(orderStatusEnum.getValue().intValue() == 0               //订单付款
                    ||orderStatusEnum.getValue().intValue() == 1        //订单结算
                    ||orderStatusEnum.getValue().intValue() == 2        //订单失效
                    ||orderStatusEnum.getValue().intValue() == 4        //维权成功
            ){
                OrderStatusVo orderStoatusVo = new OrderStatusVo();
                orderStoatusVo.setKey(orderStatusEnum.getValue());
                orderStoatusVo.setValue(orderStatusEnum.getDesc());
                orderStatusVoList.add(orderStoatusVo);
            }
        }
        return orderStatusVoList;
    }

    /**
     * 查询美团订单状态列表
     * @author liuqi
     * @date 2021/8/19 16:51
     * @return java.util.List<com.uzai.console.vo.order.OrderStatusVo>
     */
    public List<OrderStatusVo> findMtOrderStatusList(){
        //新建返回集合
        List<OrderStatusVo> orderStatusVoList = new ArrayList<OrderStatusVo>();
        //获取订单状态枚举
        OrderStatusEnum[] orderStatusesArr = OrderStatusEnum.values();
        //遍历订单状态枚举
        for (OrderStatusEnum orderStatusEnum :orderStatusesArr){
            if(orderStatusEnum.getValue().intValue() == 0               //订单付款
                    ||orderStatusEnum.getValue().intValue() == 1        //订单结算
                    ||orderStatusEnum.getValue().intValue() == 2        //订单失效
                    ||orderStatusEnum.getValue().intValue() == 4        //维权成功
            ){
                OrderStatusVo orderStoatusVo = new OrderStatusVo();
                orderStoatusVo.setKey(orderStatusEnum.getValue());
                orderStoatusVo.setValue(orderStatusEnum.getDesc());
                orderStatusVoList.add(orderStoatusVo);
            }
        }
        return orderStatusVoList;
    }

    /**
     * 查询饿了么订单状态列表
     * @author liuqi
     * @date 2021/8/19 16:51
     * @return java.util.List<com.uzai.console.vo.order.OrderStatusVo>
     */
    public List<OrderStatusVo> findElmOrderStatusList(){
        //新建返回集合
        List<OrderStatusVo> orderStatusVoList = new ArrayList<OrderStatusVo>();
        //获取订单状态枚举
        OrderStatusEnum[] orderStatusesArr = OrderStatusEnum.values();
        //遍历订单状态枚举
        for (OrderStatusEnum orderStatusEnum :orderStatusesArr){
            if(orderStatusEnum.getValue().intValue() == 0               //订单付款
                    ||orderStatusEnum.getValue().intValue() == 1        //订单结算
                    ||orderStatusEnum.getValue().intValue() == 2        //订单失效
                    ||orderStatusEnum.getValue().intValue() == 4        //维权成功
            ){
                OrderStatusVo orderStoatusVo = new OrderStatusVo();
                orderStoatusVo.setKey(orderStatusEnum.getValue());
                orderStoatusVo.setValue(orderStatusEnum.getDesc());
                orderStatusVoList.add(orderStoatusVo);
            }
        }
        return orderStatusVoList;
    }

    /**
     * 查询快手订单状态列表
     * @author liuqi
     * @date 2021/8/19 16:51
     * @return java.util.List<com.uzai.console.vo.order.OrderStatusVo>
     */
    public List<OrderStatusVo> findKsOrderStatusList(){
        //新建返回集合
        List<OrderStatusVo> orderStatusVoList = new ArrayList<OrderStatusVo>();
        //获取订单状态枚举
        OrderStatusEnum[] orderStatusesArr = OrderStatusEnum.values();
        //遍历订单状态枚举
        for (OrderStatusEnum orderStatusEnum :orderStatusesArr){
            if(orderStatusEnum.getValue().intValue() == 0               //订单付款
                    ||orderStatusEnum.getValue().intValue() == 1        //订单结算
                    ||orderStatusEnum.getValue().intValue() == 2        //订单失效
                    ||orderStatusEnum.getValue().intValue() == 4        //维权成功
            ){
                OrderStatusVo orderStoatusVo = new OrderStatusVo();
                orderStoatusVo.setKey(orderStatusEnum.getValue());
                orderStoatusVo.setValue(orderStatusEnum.getDesc());
                orderStatusVoList.add(orderStoatusVo);
            }
        }
        return orderStatusVoList;
    }

}
